<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Home</title>
<SCRIPT LANGUAGE = "JavaScript">
	var isRd=0
	var id=0;
    function checkRd(){
    	if(isRd==0){
	    	alert("choose a radio button for the selected action");
    		return false;
    	}else {
    		return true;	
    	}     
    }
     function rdClick(){
   		  	isRd=1;
     }
     function upadteClick(){
    	 if(checkRd()){
    	 	f.action="update.do";
    		 f.submit();
    	 };
     }
     function insertClick(){
	    f.action="insert.do";
	    
    	f.submit();	  	 
     }
     function deleteClick(){
    	 if(checkRd()){
    		 f.action="delete.do";
	    	 f.submit();	   	 
     	}
    }
</SCRIPT>
</head>
<body>
<form name = "f"  method="post">
      <table border="10">
      <tr>
      	  <td></td>
	      <td>id</td>
	      <td>access date</td>
   		  <td>user id</td>
      </tr>
      	<c:forEach items="${objList}" var="list">
          <tr>
          	  <td><input type=radio name="rd" value="${list.id}" onclick = "rdClick();"> </td> 
              <td>${list.id}</td>
              <td>${list.acc_date}</td>
              <td>${list.user_id}</td>
          </tr>
        </c:forEach>
      </table>
      <br>
      <br>
      <input type="button"  value="update" onclick = "upadteClick();"/>
      &nbsp;&nbsp;
      <input type="button"  value="insert" onclick = "insertClick();"/>
      &nbsp;&nbsp;	
      <input type="button"  value="delete" onclick = "deleteClick();"/>	
</form>
</body>
</html>